package com.zjff.show.zjffshow.controller;

import com.zjff.show.zjffshow.entity.CuKey;
import com.zjff.show.zjffshow.entity.ResultDao;
import com.zjff.show.zjffshow.tool.JSONTool;

import com.zjff.show.zjffshow.tool.TTSTool;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.File;

@CrossOrigin
@RestController
@RequestMapping("/Tool/")
public class ToolController {


    ResultDao resultDao = null;

    /**
     *
     * @param Text 需要转换成TTS的文本
     * @return 返回百度在线播放的URL
     */
    @GetMapping("/TTS")//调用百度AI生成TTS语音
    private String TTS(@RequestParam("Text") String Text){
       resultDao = new ResultDao();
       resultDao.setCode("0");
        resultDao.setData(new TTSTool().PlayAudioByString(Text));
        return JSONTool.getJsonTool().toJson(resultDao);
    }

}
